﻿//// See https://aka.ms/new-console-template for more information
//Console.WriteLine("Hello, World!");
//Dog dog1 = new Dog(1,"xiao");
//Dog dog2 = new Dog(1, "xiao");
//DogRecord dog3 = new DogRecord(1, "xiao");
//DogRecord dog4 = new DogRecord(1, "xiao");
//Console.WriteLine(dog1==dog2);
//Console.WriteLine(dog3==dog4);

//public class Dog
//{
//    public int Id { get; init; }
//    public string Name { get; init; }

//    public Dog(int id, string name)
//    {
//        this.Id = id;
//        this.Name = name;
//    }

//}
//record DogRecord(int Id,string Name);


MyClass mc=new MyClass { Id = 1, Name = "xiao" };

Chage(mc);

Console.WriteLine("一"+mc.Id);

void Chage(MyClass mc)
{
    mc.Id = 2;
    Console.WriteLine("二"+mc.Id);
    mc =new MyClass { Id = 3,Name = "xiao33" };
    Console.WriteLine("三"+mc.Id);
};

public class MyClass
{
    public int Id { get; set; }
    public string Name { get; set; }

}